package src.main.java.org.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;

/*
* FileOutputStream
* */
public class Test2 {
    public static void main(String[] args) throws Exception {
//        FileOutputStream fos = new FileOutputStream("src/test3.txt");
        FileOutputStream fos = new FileOutputStream("src/test3.txt",true);//追加数据
        fos.write(97);
        fos.write('b');

        byte[] bytes = "我爱你中国abc".getBytes(); //写字节数组
        fos.write(bytes);
        fos.write("\r\n".getBytes());
        fos.write(bytes,0,15); //写部分字节

        fos.close();
    }
}
